<template>
   <el-row style="padding: 5px 0;">
    <el-col :span="4">
        <i class="iconfont icon-warning" style="color: #ffba00; font-size:25px;"></i>
    </el-col>
    <el-col :span="20">
        此操作将永久删除该轮播图，是否继续?
    </el-col>
   </el-row>
   <el-row :span="24"  style="margin: 20px 0px;padding: 0 20rx;">
    <el-col :span="10" :offset="4" >
        <el-button type="default" @click="cancle">取消</el-button>
    </el-col>
    <el-col :span="7">
        <el-button type="primary" @click="save">确定</el-button>
    </el-col>
   </el-row>
</template>

<script setup>
import { defineEmits , defineProps } from 'vue';
import { ElMessage } from 'element-plus';
import axios from 'axios';
let res = "";
const emits = defineEmits(["operate"]);
let props = defineProps({
    id:{
        Required:true
    }
})


const cancle = function(){
    ElMessage("已取消删除");
    emits("operate");
}
const save = async function(){
    res = await axios.get("/api/homeCarousel/delete?id="+props.id.id)
    ElMessage({
        message: res.data.data,
        type: res.data.code == 200 ? "success" : "error"
    })
    emits("operate")
}

</script>
<style lang="less" scoped>
</style>